package com.wt.dwh.samples.spark.examples.rdd;

import org.apache.spark.SparkContext;
import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;

import java.util.Arrays;
import java.util.List;

public class FirstRddDemo {
    public static void main(String[] args) {

        SparkConf conf = new SparkConf().setAppName("firs rdd").setMaster("local[2]");
        JavaSparkContext sc = new JavaSparkContext(conf);
        List<Integer> data = Arrays.asList(1, 2, 3, 4, 5);
        JavaRDD<Integer> rdd = sc.parallelize(data);
        rdd.foreach(s->System.out.println(s));
        sc.close();
    }
}
